import request from '@/utils/request'
import qs from 'qs'
export function addMenuApi(form) {
  return request({
    url: `/menu`,
    method: 'post',
    data: form
  })
}
export function getMenuApi(id) {
  return request({
    url: `/menu/${id}`,
    method: 'get'
  })
}
export function getMenusApi(pageNo, pageSize, menu) {
  return request({
    url: `/menu?${qs.stringify(menu)}`,
    params:{
      pageNo: pageNo,
      pageSize: pageSize,
    },
    method: 'get'
  })
}
export function delMenuApi(id) {
  return request({
    url: `/menu/${id}`,
    method: 'delete'
  })
}
export function delMenusApi(menus) {
  return request({
    url: `/menu`,
    data:menus,
    method: 'delete'
  })
}
export function updateMenuApi(form) {
  return request({
    url: `/menu`,
    method: 'put',
    data:form,
  })
}
